﻿<?php include("../config.php"); 
session_start();
?>

<html>
<head>
<title><?php echo($name); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>
<body>
<h1><?php echo($name); ?></h1>
<?php
if(empty($_SESSION['login'])) {
echo("<h3>Connectez-vous pour voir cette page!");
}

else {
?>
<div style="background-color: blue; color: white;"><h3>Redirektor</h3></div>
<?php
print_r($_POST);
extract($_POST);
dbconnect();
$req = mysql_query("SELECT * FROM ".$prefix."url WHERE `key` = ".$key." LIMIT 1");
$data = mysql_fetch_assoc($req);
if($_SESSION['login'] != $data['owner']) {
echo("<p>Vous n'Ãªtes pas le propriétaire de cette URL</p>");
}
else {
echo($urltype);
if(($urltype == "time") AND (!empty($seconds))) {
echo("UPDATE `".$prefix."url` SET `type` = 'time', `refreshtime` = '".$seconds."' WHERE `key` = ".$key." LIMIT 1;");
mysql_query("UPDATE `".$prefix."url` SET `type` = 'time', `refreshtime` = '".$seconds."' WHERE `key` = ".$key." LIMIT 1;");
echo(mysql_error());
echo("ok");
}
}
}
?>

</body>
</html>

